﻿using System;
using System.Collections.Generic;
using System.Text;
using MyPetShop.Service.ValueObject;

namespace MyPetShop.Service
{
    public class ProductItemService
    {
        public IList<CategoryInfo> GetCategorys()
        {
        	IList<CategoryInfo> categories = new List<CategoryInfo>();
        	categories.Add(new CategoryInfo(){Name = "Fish"});
        	categories.Add(new CategoryInfo(){Name = "Dogs"});
        	categories.Add(new CategoryInfo(){Name = "Reptiles"});
        	categories.Add(new CategoryInfo(){Name = "Cats"});
        	categories.Add(new CategoryInfo(){Name = "Birds"});
        	
        	return categories;
        }

        public IList<ProductInfo> GetProductsByCategory(string category)
        {
            IList<ProductInfo> productInfos = new List<ProductInfo>();
            switch(category)
            {
            	case "Fish":
            		productInfos.Add(new ProductInfo() {ProductID="FI-FW-01",Name="Koi",Description=""});
            		productInfos.Add(new ProductInfo() {ProductID="FI-FW-02",Name="Goldfish",Description=""});
            		productInfos.Add(new ProductInfo() {ProductID="FI-SW-01",Name="Angelfish",Description=""});
            		productInfos.Add(new ProductInfo() {ProductID="FI-SW-02",Name="Tiger Shark",Description=""});
            		break;
            	case "Dogs":
            		productInfos.Add(new ProductInfo() {ProductID="K9-BD-01",Name="Bulldog",Description=""});
            		productInfos.Add(new ProductInfo() {ProductID="K9-CW-01",Name="Chihuahua",Description=""});
            		productInfos.Add(new ProductInfo() {ProductID="K9-DL-01",Name="Dalmation",Description=""});
            		productInfos.Add(new ProductInfo() {ProductID="K9-PO-02",Name="Poodle",Description=""});
            		break;
            }
            
            return productInfos;
        }

        public IList<ItemInfo> GetItemsByProduct(string product)
        {
            IList<ItemInfo> itemInfos = new List<ItemInfo>();
            switch(product)
            {
            	case "Koi":
            		itemInfos.Add(new ItemInfo() {ItemID="EST-4",Description="",ListPrice=18.5m});
            		itemInfos.Add(new ItemInfo() {ItemID="EST-5",Description="",ListPrice=18.5m});
            		break;
            	case "Bulldog":
            		itemInfos.Add(new ItemInfo() {ItemID="EST-6",Description="",ListPrice=18.5m});
            	    itemInfos.Add(new ItemInfo() {ItemID="EST-7",Description="",ListPrice=18.5m});
            		break;
            }

            return itemInfos;
        }

        public ItemInfo GetItem(string item)
        {
        	ItemInfo itemInfo = new ItemInfo();
        	
        	itemInfo.ItemID = item;
        	itemInfo.ListPrice = 18.5m;
        	itemInfo.Price = 18.5m;
        	itemInfo.Quantity = 99999;
            
            return itemInfo;
        }
    }


}
